<script setup>
const props = defineProps({
  size: {
    type: String,
    default: '',
  },
})
</script>
<template>
  <div class="data-box" :class="{ 'data-box-large': props.size === 'large' }">
    <div class="data-box-title">
      <slot name="title"></slot>
    </div>
    <div class="data-box-nav" v-if="$slots.nav">
      <slot name="nav"></slot>
    </div>
    <div class="data-box-content">
      <slot></slot>
    </div>
  </div>
</template>
<style lang="scss" scoped>
.data-box {
  position: relative;
  background-image: url('@/assets/images/data-box/data-box.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  width: 500px;
  height: 308px;
  padding: 16px 30px;
  .data-box-title {
    width: 100%;
    height: 50px;
    background-repeat: no-repeat;
    background-position: center;
    background-image: url('@/assets/images/data-box/data-box-title.png');
    text-align: center;
    :deep(svg) {
      margin-top: -40px;
    }
  }
  .data-box-nav {
    width: 100%;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    gap: 8px;
    :deep(div) {
      width: 128px;
      height: 26px;
      background: url('@/assets/images/data-box/nav.png') no-repeat center center;
      text-align: center;
      cursor: pointer;
      span {
        color: #62c7f2;
        font-family: PingFang SC;
        font-weight: 600;
        font-size: 14px;
      }
      &.active {
        background: url('@/assets/images/data-box/nav-active.png') no-repeat center center;
        span {
          position: relative;
          color: #fff;
          &::after {
            content: '';
            display: block;
            width: 22px;
            height: 16px;
            position: absolute;
            top: 55%;
            left: -25px;
            transform: translateY(-50%);
            background: url('@/assets/images/data-box/feather.png') no-repeat center center;
            background-size: cover;
          }
          &:before {
            content: '';
            display: block;
            width: 22px;
            height: 16px;
            position: absolute;
            top: 55%;
            right: -25px;
            transform: translateY(-50%);
            background: url('@/assets/images/data-box/feather-right.png') no-repeat center center;
            background-size: cover;
          }
        }
      }
    }
  }
  .data-box-content {
    display: flex;
    flex-direction: column;
  }
}
.data-box-large {
  width: 500px;
  height: 632px;
  background-image: url('@/assets/images/data-box/data-box-large.png');
}
</style>
